<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<%--<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>--%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>系统主页</title>
</head>
<body>
<h1>系统主页</h1>
<br/>
<br/>
<h1>
    <%--用户身份信息--%>
    <shiro:principal/>

    <shiro:authenticated>
        认证后展示的内容
    </shiro:authenticated>

    <shiro:notAuthenticated>
        没有认证的展示内容
    </shiro:notAuthenticated>
</h1>
<br/>
<a href="${pageContext.request.contextPath}/user/logout">退出系统</a>
<ul>

    <shiro:hasAnyRoles name="user,admin">
        <li><a href="">用户管理</a>
            <ul>
                <shiro:hasPermission name="user:add:*">
                    <li><a href="">添加</a></li>
                </shiro:hasPermission>

                <shiro:hasPermission name="user:delete:*">
                    <li><a href="">删除</a></li>
                </shiro:hasPermission>

                <shiro:hasPermission name="user:update:*">
                    <li><a href="">修改</a></li>
                </shiro:hasPermission>

                <shiro:hasPermission name="order:find:*">
                    <li><a href="">查询</a></li>
                </shiro:hasPermission>
            </ul>
        </li>
    </shiro:hasAnyRoles>

    <shiro:hasRole name="admin">
        <li>
            <a href="">商品管理</a>
        </li>
        <li>
            <a href="">订单管理</a>
        </li>
    </shiro:hasRole>

</ul>
</body>
</html>